﻿using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SilverlightHVP.View;
using SilverlightHVP.ViewModel;


/*
namespace SilverlightHVP.Tests
{

   [TestClass]
   public class WatchedTimeTests
   {
      List<long> valuesToWatch;
      List<long> originalValuesOrdered;
      List<long> retValues;


      [TestInitialize]
      public void WatchedTimePassed_Setup()
      {
         // put them in in random order
         valuesToWatch = new List<long>() { 30, 20, 40, 10, 1025 };

         // need to test them with ordered values
         originalValuesOrdered = ( from entry in valuesToWatch
                                   orderby entry
                                   select entry ).ToList();
      }




      [TestCleanup]
      public void WatchedTimePassed_CleanUp()
      {
         retValues = null;
      }


      [TestMethod]
      public void WatchedTimePassed_OneMatchingValuePassed_ReturnsJustFirstWatchedValue()
      {

         long valueToTest = 15;
         TestWatchedTimePassed( 1, valueToTest );
      }


      [TestMethod]
      public void WatchTimePassed_ThreeMatchingValuesPassed_ReturnsFirstThree()
      {
         long valueToTest = 30;
         TestWatchedTimePassed( 3, valueToTest );
      }

      [TestMethod]
      public void WatchedTimePassed_AllTimesPassed_ReturnsAll()
      {

         long valueToTest = 1500;
         TestWatchedTimePassed( 5, valueToTest );
      }

      [TestMethod]
      public void WatchedTimePassed_NoTimesPassed_ReturnsZero()
      {

         long valueToTest = 1;
         TestWatchedTimePassed( 0, valueToTest );
      }


      private void TestWatchedTimePassed( int numberWatchedValuesToMatch, long valueToTest )
      {
         Assert.IsNull( retValues );
         TimeManager.WatchedTimePassed( valuesToWatch, valueToTest, out retValues );
         CollectionAssert.AllItemsAreNotNull( retValues );
         CollectionAssert.AllItemsAreUnique( retValues );
         Assert.AreEqual( retValues.Count, numberWatchedValuesToMatch );
         for ( int i = 0; i < numberWatchedValuesToMatch; i++ )
         {
            Assert.AreEqual( retValues[ i ], originalValuesOrdered[ i ] );
         }
      }
   }
}

*/
